#ifndef ADAPTERSELECTOR_H
#define ADAPTERSELECTOR_H

#include <QDialog>
#include <QStringList>
#include <QPair>

namespace Ui {
class AdapterSelector;
}

class AdapterSelector : public QDialog
{
    Q_OBJECT

public:
    explicit AdapterSelector(QWidget *parent = nullptr);
    ~AdapterSelector();
    
    // 设置可用的网络适配器列表
    void setAvailableAdapters(const QList<QPair<QString, QString>>& adapters);
    
    // 获取用户选择的适配器
    QString getSelectedAdapter() const;

private slots:
    void on_listenButton_clicked();
    void on_adapterList_itemSelectionChanged();

private:
    Ui::AdapterSelector *ui;
    QString m_selectedAdapter;
    QList<QPair<QString, QString>> m_adapters; // 存储设备名和描述
};

#endif // ADAPTERSELECTOR_H